<%@ Page Language="C#" MasterPageFile="~/MasterPages/Default.Master" AutoEventWireup="true" CodeBehind="Add.aspx.cs" 
         Inherits="Mindscape.BackgroundMotion.Website.Add" Title="Add" EnableEventValidation="False" %>
<%@ Register TagPrefix="mindscape" Src="~/Controls/FlickrSearch.ascx" TagName="FlickrSearch" %>
<%@ Register TagPrefix="mindscape" Src="~/Controls/SilverlightStreaming.ascx" TagName="SilverStream" %>
<%@ Register TagPrefix="mindscape" Src="~/Controls/LiveSpacesPhotos.ascx" TagName="LivePhotos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ContentPlaceHolderID="BodyContent" runat="server">

  <h2>You can add your own contributions!</h2>
  <p>Start by using content from the providers below and then editing the contribution or just manually create a new contribution.</p>

  <asp:UpdatePanel runat="Server" ID="ContentPanel" UpdateMode="Conditional">
  <ContentTemplate>
    <asp:PlaceHolder runat="Server" ID="SelectionSection">
        <div style="clear: both; float: left;">
            <h2>Providers:</h2>
            <p><mindscape:FlickrSearch ID="FlickrSearch" runat="server" />
            <strong>Flickr</strong> is a picture hosting service. You can use this provider if you want to link to a picture stored in Flickr.</p>
            <p><mindscape:SilverStream ID="SilverStream" runat="server" />
            <strong>Silverlight Streaming</strong> is a video hosting service. You can use this provider if you want to link to a video preview of your contribution.</p>
            <p><mindscape:LivePhotos ID="LivePhotos" runat="server" />
            <strong>Live Spaces Photos</strong> is a picture hosting service. You can use this provider if you want to link to a picture stored in your Live Space.</p>
	    <br/>
	    <br/>
        </div>
    </asp:PlaceHolder>
    
    </ContentTemplate>
  </asp:UpdatePanel>
   
    <div style="clear: both;"> 
      <h2>Contribution Details:</h2>  
      
      <asp:UpdatePanel ID="ErrorsPanel" runat="Server">
      <ContentTemplate>      

        <asp:Repeater ID="ErrorsRepeater" runat="server">
          <HeaderTemplate>
            <div class="errors">
          </HeaderTemplate>
          <ItemTemplate>
              <%# Eval("Message") %><br />
          </ItemTemplate>
          <FooterTemplate>
            </div>
          </FooterTemplate>
        </asp:Repeater>
              
      </ContentTemplate>
      </asp:UpdatePanel> 
          
        
        <asp:Panel ID="ManualAddBody" runat="server" style="display:block;">
            <br />
          <div id="formBox">
          <asp:UpdatePanel runat="Server" ID="TopDetails">
          <ContentTemplate>
          <div class="row">
            <span class="label">Title:</span><asp:TextBox ID="ContributionTitle" runat="server" Width="451px" MaxLength="50" />
          </div>
          <div class="row">
            <span class="label">Description:</span><asp:TextBox ID="Description" runat="server" Width="451px" MaxLength="255" TextMode="MultiLine" CssClass="inputTheme" />
          </div>
          <div class="row">
            <span class="label">Content Type:</span><asp:DropDownList ID="ContributionContentType" runat="server" Width="451px" CssClass="inputTheme" />
          </div>
          <div class="row">
            <span class="label">Preview Link:</span><asp:TextBox ID="PreviewLink" runat="server" Width="451px" MaxLength="1024" />
          </div>
          <div class="row">
            <span class="label">Preview Image:</span><asp:TextBox ID="PreviewImage" runat="server" Width="451px" MaxLength="1024" />
          </div>
          <div class="row">
            <span class="label">Download Link:</span><asp:TextBox ID="DownloadLink" runat="server" Width="451px" MaxLength="1024" />
          </div>      
          </ContentTemplate>
          </asp:UpdatePanel>
          <div class="row">
            <div class="label" style="height:50px; width:100px; font-weight:bold; float:left;">Geo-Tag:</div><a href='#formBox' onclick='AddPushpin();'>Use location at center of map</a>. (double click to zoom)<br />         
            <div id='myMap' style="position:relative; width:455px; height:300px;border:1px solid #999999;"></div>
          </div>     
          <asp:UpdatePanel runat="Server" ID="BottomDetails">
          <ContentTemplate>
          <div class="row">
            <span class="label">Latitude:</span><asp:TextBox ID="Latitude" runat="server" Width="451px"/>
          </div> 
          <div class="row">
            <span class="label">Longitude:</span><asp:TextBox ID="Longitude" runat="server" Width="451px"/>
          </div>   
          <div class="row">
            <span class="label">Tags:</span><asp:TextBox ID="Tags" runat="server" Width="451px"/>
          </div>          
          <div class="row">
            <span class="label">&nbsp;</span>              
              <asp:Button ID="Create" runat="server" Text="Create" OnClick="Create_Click" CssClass="button" />
          </div>
          </ContentTemplate>
          </asp:UpdatePanel>
        </div>     
        </asp:Panel>
    </div>
    
        <mindscape:WebDataBinder ID="DataBinder" runat="server">
          <BindingItems>
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="Description" TargetControl="Description" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="ContentTypeId" TargetControlProperty="SelectedValue" TargetControl="ContributionContentType" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="PreviewLink" TargetControl="PreviewLink" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="PreviewImage" TargetControl="PreviewImage" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="DownloadLink" TargetControl="DownloadLink" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="Title" TargetControl="ContributionTitle" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="PopularCloud" TargetControl="Tags" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="GeoXString" TargetControl="Latitude" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="GeoYString" TargetControl="Longitude" />
            <mindscape:WebDataBindingItem runat="server" BindingSource="Contribution" BindingSourceMember="Tags" TargetControl="Tags" />
          </BindingItems>
        </mindscape:WebDataBinder>
</asp:Content>
